\(\int \cot ^2(c+d x) \csc (c+d x) (a+b \sin (c+d x))^2 \, dx\) [1064]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 27, antiderivative size = 89 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+b \sin (c+d x))^2 \, dx=-2 a b x+\frac {\left (a^2-2 b^2\right ) \text {arctanh}(\cos (c+d x))}{2 d}+\frac {3 b^2 \cos (c+d x)}{2 d}-\frac {a b \cot (c+d x)}{d}-\frac {\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^2}{2 d} \]

[Out]

-2*a*b*x+1/2*(a^2-2*b^2)*arctanh(cos(d*x+c))/d+3/2*b^2*cos(d*x+c)/d-a*b*cot(d*x+c)/d-1/2*cot(d*x+c)*csc(d*x+c)
*(a+b*sin(d*x+c))^2/d

Rubi [A] (verified)

Time = 0.22 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {2968, 3127, 3110, 3102, 2814, 3855} \[ \int \cot ^2(c+d x) \csc (c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {\left (a^2-2 b^2\right ) \text {arctanh}(\cos (c+d x))}{2 d}-\frac {a b \cot (c+d x)}{d}-\frac {\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^2}{2 d}-2 a b x+\frac {3 b^2 \cos (c+d x)}{2 d} \]

[In]

Int[Cot[c + d*x]^2*Csc[c + d*x]*(a + b*Sin[c + d*x])^2,x]

[Out]

-2*a*b*x + ((a^2 - 2*b^2)*ArcTanh[Cos[c + d*x]])/(2*d) + (3*b^2*Cos[c + d*x])/(2*d) - (a*b*Cot[c + d*x])/d - (
Cot[c + d*x]*Csc[c + d*x]*(a + b*Sin[c + d*x])^2)/(2*d)

Rule 2814

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*(x/d)
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rule 2968

Int[cos[(e_.) + (f_.)*(x_)]^2*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)
, x_Symbol] :> Int[(d*Sin[e + f*x])^n*(a + b*Sin[e + f*x])^m*(1 - Sin[e + f*x]^2), x] /; FreeQ[{a, b, d, e, f,
 m, n}, x] && NeQ[a^2 - b^2, 0] && (IGtQ[m, 0] || IntegersQ[2*m, 2*n])

Rule 3102

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (
f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Dist[1/(
b*(m + 2)), Int[(a + b*Sin[e + f*x])^m*Simp[A*b*(m + 2) + b*C*(m + 1) + (b*B*(m + 2) - a*C)*Sin[e + f*x], x],
x], x] /; FreeQ[{a, b, e, f, A, B, C, m}, x] &&  !LtQ[m, -1]

Rule 3110

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])*((A_.) + (B_.)*sin[(e
_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-(b*c - a*d))*(A*b^2 - a*b*B + a^2*C)
*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b^2*f*(m + 1)*(a^2 - b^2))), x] - Dist[1/(b^2*(m + 1)*(a^2 - b^2)
), Int[(a + b*Sin[e + f*x])^(m + 1)*Simp[b*(m + 1)*((b*B - a*C)*(b*c - a*d) - A*b*(a*c - b*d)) + (b*B*(a^2*d +
 b^2*d*(m + 1) - a*b*c*(m + 2)) + (b*c - a*d)*(A*b^2*(m + 2) + C*(a^2 + b^2*(m + 1))))*Sin[e + f*x] - b*C*d*(m
 + 1)*(a^2 - b^2)*Sin[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, B, C}, x] && NeQ[b*c - a*d, 0] &&
NeQ[a^2 - b^2, 0] && LtQ[m, -1]

Rule 3127

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (C_.)*s
in[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-(c^2*C + A*d^2))*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Si
n[e + f*x])^(n + 1)/(d*f*(n + 1)*(c^2 - d^2))), x] + Dist[1/(d*(n + 1)*(c^2 - d^2)), Int[(a + b*Sin[e + f*x])^
(m - 1)*(c + d*Sin[e + f*x])^(n + 1)*Simp[A*d*(b*d*m + a*c*(n + 1)) + c*C*(b*c*m + a*d*(n + 1)) - (A*d*(a*d*(n
 + 2) - b*c*(n + 1)) - C*(b*c*d*(n + 1) - a*(c^2 + d^2*(n + 1))))*Sin[e + f*x] - b*(A*d^2*(m + n + 2) + C*(c^2
*(m + 1) + d^2*(n + 1)))*Sin[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, C}, x] && NeQ[b*c - a*d, 0]
 && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && GtQ[m, 0] && LtQ[n, -1]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \int \csc ^3(c+d x) (a+b \sin (c+d x))^2 \left (1-\sin ^2(c+d x)\right ) \, dx \\ & = -\frac {\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^2}{2 d}+\frac {1}{2} \int \csc ^2(c+d x) (a+b \sin (c+d x)) \left (2 b-a \sin (c+d x)-3 b \sin ^2(c+d x)\right ) \, dx \\ & = -\frac {a b \cot (c+d x)}{d}-\frac {\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^2}{2 d}-\frac {1}{2} \int \csc (c+d x) \left (a^2-2 b^2+4 a b \sin (c+d x)+3 b^2 \sin ^2(c+d x)\right ) \, dx \\ & = \frac {3 b^2 \cos (c+d x)}{2 d}-\frac {a b \cot (c+d x)}{d}-\frac {\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^2}{2 d}-\frac {1}{2} \int \csc (c+d x) \left (a^2-2 b^2+4 a b \sin (c+d x)\right ) \, dx \\ & = -2 a b x+\frac {3 b^2 \cos (c+d x)}{2 d}-\frac {a b \cot (c+d x)}{d}-\frac {\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^2}{2 d}-\frac {1}{2} \left (a^2-2 b^2\right ) \int \csc (c+d x) \, dx \\ & = -2 a b x+\frac {\left (a^2-2 b^2\right ) \text {arctanh}(\cos (c+d x))}{2 d}+\frac {3 b^2 \cos (c+d x)}{2 d}-\frac {a b \cot (c+d x)}{d}-\frac {\cot (c+d x) \csc (c+d x) (a+b \sin (c+d x))^2}{2 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 1.30 (sec) , antiderivative size = 155, normalized size of antiderivative = 1.74 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {-16 a b c-16 a b d x+8 b^2 \cos (c+d x)-8 a b \cot \left (\frac {1}{2} (c+d x)\right )-a^2 \csc ^2\left (\frac {1}{2} (c+d x)\right )+4 a^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-8 b^2 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )\right )-4 a^2 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+8 b^2 \log \left (\sin \left (\frac {1}{2} (c+d x)\right )\right )+a^2 \sec ^2\left (\frac {1}{2} (c+d x)\right )+8 a b \tan \left (\frac {1}{2} (c+d x)\right )}{8 d} \]

[In]

Integrate[Cot[c + d*x]^2*Csc[c + d*x]*(a + b*Sin[c + d*x])^2,x]

[Out]

(-16*a*b*c - 16*a*b*d*x + 8*b^2*Cos[c + d*x] - 8*a*b*Cot[(c + d*x)/2] - a^2*Csc[(c + d*x)/2]^2 + 4*a^2*Log[Cos
[(c + d*x)/2]] - 8*b^2*Log[Cos[(c + d*x)/2]] - 4*a^2*Log[Sin[(c + d*x)/2]] + 8*b^2*Log[Sin[(c + d*x)/2]] + a^2
*Sec[(c + d*x)/2]^2 + 8*a*b*Tan[(c + d*x)/2])/(8*d)

Maple [A] (verified)

Time = 0.38 (sec) , antiderivative size = 102, normalized size of antiderivative = 1.15

method result size
derivativedivides \(\frac {a^{2} \left (-\frac {\cos ^{3}\left (d x +c \right )}{2 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )}{2}-\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )+2 a b \left (-\cot \left (d x +c \right )-d x -c \right )+b^{2} \left (\cos \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )}{d}\) \(102\)
default \(\frac {a^{2} \left (-\frac {\cos ^{3}\left (d x +c \right )}{2 \sin \left (d x +c \right )^{2}}-\frac {\cos \left (d x +c \right )}{2}-\frac {\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )}{2}\right )+2 a b \left (-\cot \left (d x +c \right )-d x -c \right )+b^{2} \left (\cos \left (d x +c \right )+\ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )\right )}{d}\) \(102\)
parallelrisch \(\frac {4 \left (-a^{2}+2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )+a^{2} \left (\sec ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right ) \left (\csc ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+8 \csc \left (\frac {d x}{2}+\frac {c}{2}\right ) \sec \left (\frac {d x}{2}+\frac {c}{2}\right ) a b -a^{2} \left (\cot ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-16 a b x d -16 a b \cot \left (\frac {d x}{2}+\frac {c}{2}\right )+8 \cos \left (d x +c \right ) b^{2}-8 b^{2}}{8 d}\) \(131\)
risch \(-2 a b x +\frac {{\mathrm e}^{i \left (d x +c \right )} b^{2}}{2 d}+\frac {{\mathrm e}^{-i \left (d x +c \right )} b^{2}}{2 d}-\frac {i a \left (i a \,{\mathrm e}^{3 i \left (d x +c \right )}+i a \,{\mathrm e}^{i \left (d x +c \right )}+4 b \,{\mathrm e}^{2 i \left (d x +c \right )}-4 b \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{2}}+\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{2 d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right ) b^{2}}{d}-\frac {a^{2} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{2 d}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right ) b^{2}}{d}\) \(182\)
norman \(\frac {\frac {a b \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {a b \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {a^{2}}{8 d}+\frac {a^{2} \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 d}-\frac {\left (a^{2}-4 b^{2}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {\left (a^{2}-4 b^{2}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}-\frac {a b \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}-\frac {a b \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-2 a b x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-4 a b x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-2 a b x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} \left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}-\frac {\left (a^{2}-2 b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 d}\) \(247\)

[In]

int(cos(d*x+c)^2*csc(d*x+c)^3*(a+b*sin(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(a^2*(-1/2/sin(d*x+c)^2*cos(d*x+c)^3-1/2*cos(d*x+c)-1/2*ln(csc(d*x+c)-cot(d*x+c)))+2*a*b*(-cot(d*x+c)-d*x-
c)+b^2*(cos(d*x+c)+ln(csc(d*x+c)-cot(d*x+c))))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 168 vs. \(2 (83) = 166\).

Time = 0.30 (sec) , antiderivative size = 168, normalized size of antiderivative = 1.89 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {8 \, a b d x \cos \left (d x + c\right )^{2} - 4 \, b^{2} \cos \left (d x + c\right )^{3} - 8 \, a b d x - 8 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) - 2 \, {\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right ) - {\left ({\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - a^{2} + 2 \, b^{2}\right )} \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) + {\left ({\left (a^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )^{2} - a^{2} + 2 \, b^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{4 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )}} \]

[In]

integrate(cos(d*x+c)^2*csc(d*x+c)^3*(a+b*sin(d*x+c))^2,x, algorithm="fricas")

[Out]

-1/4*(8*a*b*d*x*cos(d*x + c)^2 - 4*b^2*cos(d*x + c)^3 - 8*a*b*d*x - 8*a*b*cos(d*x + c)*sin(d*x + c) - 2*(a^2 -
 2*b^2)*cos(d*x + c) - ((a^2 - 2*b^2)*cos(d*x + c)^2 - a^2 + 2*b^2)*log(1/2*cos(d*x + c) + 1/2) + ((a^2 - 2*b^
2)*cos(d*x + c)^2 - a^2 + 2*b^2)*log(-1/2*cos(d*x + c) + 1/2))/(d*cos(d*x + c)^2 - d)

Sympy [F]

\[ \int \cot ^2(c+d x) \csc (c+d x) (a+b \sin (c+d x))^2 \, dx=\int \left (a + b \sin {\left (c + d x \right )}\right )^{2} \cos ^{2}{\left (c + d x \right )} \csc ^{3}{\left (c + d x \right )}\, dx \]

[In]

integrate(cos(d*x+c)**2*csc(d*x+c)**3*(a+b*sin(d*x+c))**2,x)

[Out]

Integral((a + b*sin(c + d*x))**2*cos(c + d*x)**2*csc(c + d*x)**3, x)

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.16 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+b \sin (c+d x))^2 \, dx=-\frac {8 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} a b - a^{2} {\left (\frac {2 \, \cos \left (d x + c\right )}{\cos \left (d x + c\right )^{2} - 1} + \log \left (\cos \left (d x + c\right ) + 1\right ) - \log \left (\cos \left (d x + c\right ) - 1\right )\right )} - 2 \, b^{2} {\left (2 \, \cos \left (d x + c\right ) - \log \left (\cos \left (d x + c\right ) + 1\right ) + \log \left (\cos \left (d x + c\right ) - 1\right )\right )}}{4 \, d} \]

[In]

integrate(cos(d*x+c)^2*csc(d*x+c)^3*(a+b*sin(d*x+c))^2,x, algorithm="maxima")

[Out]

-1/4*(8*(d*x + c + 1/tan(d*x + c))*a*b - a^2*(2*cos(d*x + c)/(cos(d*x + c)^2 - 1) + log(cos(d*x + c) + 1) - lo
g(cos(d*x + c) - 1)) - 2*b^2*(2*cos(d*x + c) - log(cos(d*x + c) + 1) + log(cos(d*x + c) - 1)))/d

Giac [A] (verification not implemented)

none

Time = 0.45 (sec) , antiderivative size = 148, normalized size of antiderivative = 1.66 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 16 \, {\left (d x + c\right )} a b + 8 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 4 \, {\left (a^{2} - 2 \, b^{2}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) \right |}\right ) + \frac {16 \, b^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1} + \frac {6 \, a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 12 \, b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 8 \, a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - a^{2}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2}}}{8 \, d} \]

[In]

integrate(cos(d*x+c)^2*csc(d*x+c)^3*(a+b*sin(d*x+c))^2,x, algorithm="giac")

[Out]

1/8*(a^2*tan(1/2*d*x + 1/2*c)^2 - 16*(d*x + c)*a*b + 8*a*b*tan(1/2*d*x + 1/2*c) - 4*(a^2 - 2*b^2)*log(abs(tan(
1/2*d*x + 1/2*c))) + 16*b^2/(tan(1/2*d*x + 1/2*c)^2 + 1) + (6*a^2*tan(1/2*d*x + 1/2*c)^2 - 12*b^2*tan(1/2*d*x
+ 1/2*c)^2 - 8*a*b*tan(1/2*d*x + 1/2*c) - a^2)/tan(1/2*d*x + 1/2*c)^2)/d

Mupad [B] (verification not implemented)

Time = 11.12 (sec) , antiderivative size = 397, normalized size of antiderivative = 4.46 \[ \int \cot ^2(c+d x) \csc (c+d x) (a+b \sin (c+d x))^2 \, dx=\frac {\cos \left (c+d\,x\right )\,\left (\frac {a^2}{2}-\frac {b^2}{4}\right )-\frac {b^2}{2}+\frac {a^2\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{4}-\frac {b^2\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{2}+\frac {b^2\,\cos \left (2\,c+2\,d\,x\right )}{2}+\frac {b^2\,\cos \left (3\,c+3\,d\,x\right )}{4}-2\,a\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2+4\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b-2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^2}{-\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2+4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b+2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^2}\right )-\frac {a^2\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (2\,c+2\,d\,x\right )}{4}+\frac {b^2\,\ln \left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )\,\cos \left (2\,c+2\,d\,x\right )}{2}+a\,b\,\sin \left (2\,c+2\,d\,x\right )+2\,a\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2+4\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b-2\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^2}{-\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^2+4\,\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b+2\,\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )\,b^2}\right )\,\cos \left (2\,c+2\,d\,x\right )}{d\,\left ({\cos \left (c+d\,x\right )}^2-1\right )} \]

[In]

int((cos(c + d*x)^2*(a + b*sin(c + d*x))^2)/sin(c + d*x)^3,x)

[Out]

(cos(c + d*x)*(a^2/2 - b^2/4) - b^2/2 + (a^2*log(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/4 - (b^2*log(sin(c/2
+ (d*x)/2)/cos(c/2 + (d*x)/2)))/2 + (b^2*cos(2*c + 2*d*x))/2 + (b^2*cos(3*c + 3*d*x))/4 - 2*a*b*atan((a^2*sin(
c/2 + (d*x)/2) - 2*b^2*sin(c/2 + (d*x)/2) + 4*a*b*cos(c/2 + (d*x)/2))/(2*b^2*cos(c/2 + (d*x)/2) - a^2*cos(c/2
+ (d*x)/2) + 4*a*b*sin(c/2 + (d*x)/2))) - (a^2*log(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2))*cos(2*c + 2*d*x))/4
+ (b^2*log(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2))*cos(2*c + 2*d*x))/2 + a*b*sin(2*c + 2*d*x) + 2*a*b*atan((a^2
*sin(c/2 + (d*x)/2) - 2*b^2*sin(c/2 + (d*x)/2) + 4*a*b*cos(c/2 + (d*x)/2))/(2*b^2*cos(c/2 + (d*x)/2) - a^2*cos
(c/2 + (d*x)/2) + 4*a*b*sin(c/2 + (d*x)/2)))*cos(2*c + 2*d*x))/(d*(cos(c + d*x)^2 - 1))